import { Tag } from 'antd';
import styles from './index.module.less';
import { cangWeiTypes, isLocal } from '@/utils';
export default function PositionType({ record, showFangXiang = true }: any) {
  const newSize = record?.size * record?.userDirection;
  return (
    <div className={styles.pscoinInfo} key="hy">
      <p>
        {isLocal() && record?.id + ','}
        {record?.contract}
      </p>
      <div className={styles.pbot}>
        {showFangXiang && (
          <Tag color={newSize > 0 ? 'error' : 'success'}>{newSize > 0 ? '多' : '空'}</Tag>
        )}
        <Tag color="default">
          {`${cangWeiTypes[record?.leverInfo?.type]}, ${record?.leverInfo?.lever}X`}
        </Tag>
      </div>
    </div>
  );
}
